//
//  ProjectListPageView.swift
//  Fast
//
//  Created by Kael on 2020/1/14.
//  Copyright © 2020 Kael. All rights reserved.
//

import SwiftUI

struct ProjectListPageView: View {
    
    @State var projectData = Array<Any>()
    
    var body: some View {
        VStack{
            Text("请选择你要准备打包的项目！")
                .padding(10)
                .frame(maxWidth: 200, maxHeight: 20, alignment: .leading)
                .background(Color.orange)
            
            ScrollView{
                renderProjectList()
                renderProjectList()
                renderProjectList()
                renderProjectList()
                renderProjectList()
                renderProjectList()
                renderProjectList()
                renderProjectList()
            }
            

        }
        .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
    }
    
    func renderProjectList() -> AnyView {
        
        return AnyView(
            Group{
                ForEach (0..<5) { item in
                    Text("Hello, World! -->>: \(item)")
                }
            }
            .padding(10)
            .background(Color.green)
            .frame(maxWidth: .infinity)
        )
            
    }

    
}

struct ProjectListPageView_Previews: PreviewProvider {
    static var previews: some View {
        ProjectListPageView()
    }
}
